package com.ckzp.jfinal.system.validate;

import com.ckzp.jfinal.base.Validator;
import com.jfinal.core.Controller;

/**
 * Created by 51594 on 2022/9/10.
 */
public class SysUserValidator extends Validator {

    /**
     * validate
     *
     * @param controller
     */
    protected void validate(Controller controller) {
        validateRequiredString("login_id", "登陆帐号不能为空");
        validateRequiredLength("login_id", 4, 10, "登陆帐号长度为{1}至{2}之间");
        validateRequiredString("user_name", "请输入用户姓名");
        validateRequiredString("dept_id", "请选择部门");
        validatePhoneNumber("user_phone", "请输入正确的手机号");
        validateFieldExit("sys_user", "emp_id", "login_id", "登陆帐号已存在");
    }
}
